class Armazenamento < ActiveRecord::Base
  belongs_to :deposito
  belongs_to :transporte
  
  attr_accessor :should_destroy
  
  #validates_associated :transporte, :deposito
  
  #validates_associated :deposito
  
  #validates_presence_of :pares, :cxs, :deposito, :transporte

#  named_scope :box_deposito_transporte, lambda { |deposito|
#    {:include => :depositos, :conditions => ['depositos.id = ?',deposito]}
#  }
  named_scope :deposito_transporte, lambda { |deposito, transporte|
    {:conditions => ['deposito_id = ? and transporte_id = ?',deposito, transporte]}
  }
  
  def should_destroy?
	should_destroy.to_i == 1
  end

end
